package com.swordliu.facebook.service.impl;

import com.swordliu.facebook.dao.PermissionMapper;
import com.swordliu.facebook.dao.base.BaseMapper;
import com.swordliu.facebook.pojo.entity.Permission;
import com.swordliu.facebook.service.PermissionService;
import com.swordliu.facebook.service.base.BaseServiceSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;

/**
 * PermissionServiceImpl
 * Created by SwordLiu on 2017-07-24.
 */
@Service
public class PermissionServiceImpl extends BaseServiceSupport<Permission> implements PermissionService {

    @Autowired
    private PermissionMapper permissionMapper;

    @Override
    public List<Permission> getPermissions() throws Exception {
        List<Permission> list = permissionMapper.selectPermissions();
        return list;
    }

    @Override
    public Set<String> getPermissionKeys(Long id) {
        return permissionMapper.selectPermissionKeys(id);
    }

    @Override
    protected BaseMapper<Permission> getBaseMapper() {
        return permissionMapper;
    }
}
